package com.jt.assistant.api

import com.jt.assistant.base.BaseResult
import com.jt.assistant.bean.*
import okhttp3.RequestBody
import retrofit2.http.*

/**
 */
interface ApiService {

    //用户登录
    @POST("app/user/login")
    suspend fun login(
        @Header("Authorization") authorization: String?,
        @Body param: Param?
    ): BaseResult<LoginDataBean>


    @POST("app/query/scancode")
    suspend fun getScanList(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body map: Map<String, String>
    ): BaseResult<ScanDataBean>


    @POST("app/send/scanlog")
    suspend fun sendScanLog(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body list: MutableList<ScanCarton>
    ): BaseResult<Any>


    @POST("app/send/onekeyScan")
    suspend fun oneKeyScan(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body list: MutableList<OnKeyScanCarton>
    ): BaseResult<Any>

    @POST("/app/send/onekeyScanQuery")
    suspend fun onekeyScanQuery(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body list: MutableList<OnKeyScanCarton>
    ): BaseResult<Boolean>


    @POST("app/modify/waybill")
    suspend fun modifyWaybill(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?
    ): BaseResult<Any>

    @GET("app/query/deliver/truck")
    suspend fun getDeliverTruck(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
    ): BaseResult<MutableList<AddCarSearchBean>>

    @POST("/app/getCarList")
    suspend fun getCarList(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?
    ): BaseResult<CarSearchBean>

    @POST("/app/getReceiveWarePlanSelfDelivery")
    suspend fun getCarPlanList(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?
    ): BaseResult<CarSelfBean>

    @POST("/app/getDic")
    suspend fun getDic(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?
    ): BaseResult<MutableList<DicBean>>

    @POST("app/add/deliver/waybill")
    suspend fun addDeliverCar(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?
    ): BaseResult<Any>

    @POST("app/generate/receipt")
    suspend fun generateReceipt(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?
    ): BaseResult<Any>

    @POST("app/query/store/city")
    suspend fun getStoreCityList(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
    ): BaseResult<MutableList<CityBean>>

    @POST("app/query/forwarder/waybill")
    suspend fun getForwarderWaybillList(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body map: Map<String, String>
    ): BaseResult<Any>

    @POST("app/query/waybill/sku")
    suspend fun getWaybillSkuList(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body map: Map<String, String>
    ): BaseResult<Any>

    @Multipart
    @POST("app/upload/forwarder/waybill")
    suspend fun uploadForwarderWaybill(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Part("content") param: Param?,
        @PartMap map: Map<String,  @JvmSuppressWildcards RequestBody>
    ): BaseResult<Any>

    @Multipart
    @POST("app/upload/jd/receivereport")
    suspend fun uploadJdReceiveReport(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Part("content") param: Param?,
        @PartMap map: Map<String,  @JvmSuppressWildcards RequestBody>
    ):  BaseResult<Any>

    @POST("app/query/intransit/truck")
    suspend fun getIntransitTruck(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<MutableList<CarReceiveBean>>

    @POST("app/query/selfSendPlan")
    suspend fun selfSendPlan(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<MutableList<DeliveryBean>>

    @POST("/app/query/truck/detail")
    suspend fun getIntransitTruckDetail(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<MutableList<CarReceiveDetailBean>>

    @POST("/app/deliveryReceipt/create")
    suspend fun deliveryReceiptCreate(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<DocumentDetail>

    @Multipart
    @POST("app/upload/driver/deliveryreceipt")
    @JvmSuppressWildcards
    suspend fun uploadDriverDeliveryReceipt(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Part("content") param: Param?,
        @PartMap map: Map<String, RequestBody>
    ): BaseResult<Any>

    @Multipart
    @POST("app/deliveryReceipt/imgUp")
    @JvmSuppressWildcards
    suspend fun uploadDriverDeliveryImgUp(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Part("content") param: Param?,
        @PartMap map: Map<String, RequestBody>
    ): BaseResult<Any>

    @Multipart
    @POST("app/addHandingFee")
    @JvmSuppressWildcards
    suspend fun addHandingFee(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Part("content") param: Param?,
        @PartMap map: Map<String, RequestBody>
    ): BaseResult<Any>

    @Multipart
    @POST("app/returns/upload/deliveryreceipt")
    @JvmSuppressWildcards
    suspend fun uploadReturnsStoreDeliveryReceipt(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Part("content") param: Param?,
        @PartMap map: Map<String, RequestBody>
    ): BaseResult<Any>

    @POST("app/returns/query/waybill/sku")
    suspend fun getReturnsSkuListByWaybill(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<ReturnSkuBean>

    @POST("app/queryWaybillDetail")
    suspend fun waybillDetail(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<List<HandingFeeWaybillList>>

    @POST("app/query/waybill/sku")
    suspend fun getSkuListByWaybill(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<MutableList<SkuListBean>>

    @POST("app/returns/send/packinglist")
    suspend fun sendReturnsPackingList(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<CartonResponseBean>

    @POST("app/returns/modify/waybill")
    suspend fun modifyReturnsWaybill(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<Any>

    @POST("app/returns/query/scancode")
    suspend fun getReturnsScanList(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body map: Map<String, String>
    ): BaseResult<ScanDataBean>

    @POST("app/returns/returns/scan")
    suspend fun sendReturnsScanLog(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body list: MutableList<ScanCarton>
    ): BaseResult<Any>

    @POST("app/return/query/packinglist")
    suspend fun getPackingSkuList(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body map: Map<String, String>
    ): BaseResult<Any>

    @POST("app/upgrade")
    suspend fun checkUpgrade(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<Any>

    @POST("app/query/forwarderList")
    suspend fun forwarderList(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
    ): BaseResult<MutableList<ForwarderListBean>>

    @POST("app/query/forwarder/waybill")
    suspend fun queryWaybillByCity(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<MutableList<WaybillCityBean>>

    @POST("app/returns/query/packinglist")
    suspend fun getReturnsCartonDetail(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<CartonResponseBean>

    @POST("/app/getSkuByChannelOrder")
    suspend fun getSkuByChannelOrder(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<MutableList<SkuBean>>

    @POST("/app/getWareFileBySku")
    suspend fun getWareFileBySku(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<MutableList<String>>

    @Multipart
    @POST("/app/upload/wareFile")
    @JvmSuppressWildcards
    suspend fun wareFile(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Part("content") param: Param?,
        @PartMap map: Map<String, RequestBody>
    ): BaseResult<Any>

    @POST("/app/getEntrustBookByCartonCode")
    suspend fun getEntrustBookByCartonCode(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<EntrustBean>

    @POST("/app/getCityNameList")
    suspend fun getCityNameList(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String
    ): BaseResult<CarCityBean>

    @POST("/app/relationCity")
    suspend fun relationCity(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<Any>

    @POST("/app/getNoCheckWaybillCarList")
    suspend fun getNoCheckWaybillCarList(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String
    ): BaseResult<CarViewBean>

    @POST("/app/carWaybillList")
    suspend fun carWaybillList(
        @Header("Authorization") authorization: String?,
        @Header("Token") token: String,
        @Body param: Param?,
    ): BaseResult<CarViewDetailBean>


    //京东大仓数据统计
    @GET
    suspend fun getUpgradeUlr(
        @Header("Authorization") authorization: String?,
        @Url url: String
    ): BaseResult<UpdateBean>

    //京东大仓数据统计
    @POST
    suspend fun getUpgrade(
        @Header("Authorization") authorization: String?,
        @Header("Blade-Auth") blade_auth: String?,
        @Url url: String,
        @Body appInfo: AppInfo
    ): BaseResult<UpdateAppBean>



}